library(here)
data <- read_csv(
here("data", "raw", "messy-data.csv")
)King’s Open Research Summer School
July 25, 2025
My aim is to surface key tools and habits — you’ll need to explore further on your own.
Reproducibility is necessary for open science, but not sufficient. Broader change in motivations, incentives, and culture is essential.
“Research can be open and reproducible and still completely and obviously wrong.”
Richard McElreath
final_final_v3.csvdata/raw/YYYY-MM-DD├── data
│ ├── raw
│ └── clean
├── 1-cleaning
├── 2-analysis
│ ├── a-descriptives
│ ├── b-models
│ └── c-processing
├── 3-figures
├── 4-writing
└── README.txt
setwd() is banned
🧨 Absolute file paths are brittle.
🎒 Relative file paths are portable.
This works well with RStudio projects.
Write modular code; break tasks into functions or scripts (e.g., scripts cleaning, analysis, visualisation).
Follow a style guide1 and use a code formatter2.
Document with inline comments and README.md files.
Use consistent file and variable naming conventions (e.g., snake_case).
Use git.
Initialise the repository:
Then on GitHub, create a new repository and connect the remote repository to your local one:
Push your changes to GitHub
Then, repeat: